<?php
/*
 * Created on Sep 10, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

class HtmlHelper {
	
	public function formStart($action = "", $id = "", $name = "", $method = "post", $attributes = array()) {
		$form = "<form ";
		if ($action != "") {
			$form .= "action=\"" . $action . "\" ";
		}
		if ($id != "") {
			$form .= "id=\"" . $id . "\" ";
		}
		if ($name != "") {
			$form .= "name=\"" . $name . "\" ";
		}
		if ($method != "") {
			$form .= "method=\"" . $method . "\" ";
		}
		
		if ($attributes != "" && count($attributes) > 0) {
			foreach ($attributes as $key => $value) {
				$form .= $key . "=\"" . $value . "\" ";
			}
		}
		$form .= ">";
		
		return $form;
	}	
	
	public function formEnd() {
		return "</form>";
	}
}

?>

